package com.soats.demo8.Util;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Result implements Serializable {
    private int code = 0;
    private String message;
    private Object result;

    public static Result suc(Object rst){
        return Result.builder().result(rst).message("succeed").build();
    }

    public static Result suc(String msg, Object rst){
        return Result.builder().result(rst).message(msg).build();
    }
}
